package com.cpp.server.controller;

import com.cpp.common.constant.ModuleConstant;
import com.cpp.common.result.Result;
import com.cpp.pojo.pojo.Subject;
import com.cpp.server.aspect.annotation.MyLog;
import com.cpp.server.service.SubjectService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/subject")
@MyLog(module = ModuleConstant.OTHERS)
public class SubjectController {

    private final SubjectService subjectService;

    //查询科目
    @GetMapping(value = "/list")
    public Result<List<Subject>> listSubject() {
        List<Subject> list = subjectService.list();
        return Result.success(list);
    }
//    //修改科目
//    @GetMapping(value = "/update")
//    public Result updateSubject(SubjectUpdateDTO subjectUpdateDTO) {
//        subjectService.updateSubject(subjectUpdateDTO);
//        return Result.success();
//    }
//
//    //增加科目
//    @GetMapping(value = "/save")
//    public Result saveSubject(SubjectCreateDTO subjectCreateDTO) {
//        subjectService.saveSubject(subjectCreateDTO);
//        return Result.success();
//    }

    //删除科目
//    @GetMapping(value = "/delete")
//    public Result deleteSubject(@RequestParam List<Long> ids) {
//        subjectService.deleteSubject(ids);
//        return Result.success();
//    }

}
